<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<h1>Gestionar Turnos</h1>

<logic:present name="Turno" >
    <div class="center" >
    <div id="alerta" >
    <bean:write name="Turno" property="mensaje" />
    </div></div>
</logic:present>

<table>
    <thead>
        <th>Sede</th>
        <th>Dia</th>
        <th>Hora</th>
        <th>Capacidad</th>
        <th></th>
    </thead>
    <tr>
        <html:form action="/Administrador/Turnos.do?method=add" >
            <html:hidden property="id" value="" />
            <td><html:select property="sede"  value="SARTENEJAS">
                    <html:option value="SARTENEJAS" />
                    <html:option value="LITORAL" />
                </html:select></td>
            <td><html:text property="dia"  value="" size="8"/></td>
            <td><html:text property="hora"  value="" size="5"/></td>
            <td><html:text property="capacidad" value="" size="5" onkeypress="return validar_texto(event)"/></td>
            <td><tiles:insert page="/formularios/submit/agregar.jsp"  flush="false"/></td>
        </html:form>
    </tr>
    <logic:iterate name="turnos" id="T" >
        <tr>
            
                <td><html:form action="/Administrador/Turnos.do?method=update" >
                <html:hidden name="T" property="id" />
                <html:select name="T" property="sede" >
                        <html:option value="SARTENEJAS" />
                        <html:option value="LITORAL" />
                    </html:select></td>
                <td><html:text name="T" property="dia" size="8" /></td>
                <td><html:text name="T" property="hora" size="5" /></td>
                <td><html:text name="T" property="capacidad" size="5" onkeypress="return validar_texto(event)" /></td>
                <td>
                    <tiles:insert page="/formularios/submit/modificar.jsp" flush="false" />
                </html:form>
                <html:form action="/Administrador/Turnos.do?method=delete" >
                    <html:hidden name="T" property="id" />
                    <tiles:insert page="/formularios/submit/eliminar.jsp" flush="false"/>
                </html:form>
            </td>
        </tr>
    </logic:iterate>
</table>

<h2></h2>